//
//  ShowBrainVC.m
//  MyRobotApp
//
//  Created by 小肥羊 on 15/6/4.
//  Copyright (c) 2015年 小肥羊. All rights reserved.
//

#import "ShowBrainVC.h"
#import "XFYRobotMemory.h"
#import "XFYLocalData+Statistics.h"


@interface ShowBrainVC ()

@property (nonatomic, strong) XFYRobotMemory *robotMemory;

@end

@implementation ShowBrainVC

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    self.robotMemory = [[XFYRobotMemory alloc] initMemory:kMyName];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}
- (IBAction)test1:(UIButton *)sender {
    NSLog(@"测试添加碎片");
    [self.robotMemory.memory addFragmentData:@"bbbb"];
}
- (IBAction)test2:(UIButton *)sender {
    [self.robotMemory AllMemories];
//    FMResultSet *data = [self.robotMemory.memory searchAllFragmentData];
//    while ([data next]) {
//        NSString *FragmentData = [data objectForColumnName:@"FragmentData"];
//        NSLog(@"%@",FragmentData);
//    }
}
- (IBAction)test3:(UIButton *)sender {
    NSLog(@"ghosts:%ld",(long)[self.robotMemory.memory messageCount:@"ghosts"]);
}
- (IBAction)test4:(UIButton *)sender {
    NSLog(@"测试添加认知");
    [self.robotMemory.memory addCognition:@"我" CognitionTableName:@"MyCognitionTable"];
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
